import {ref} from 'vue'
import {defineStore} from 'pinia'


export const useContextStore = defineStore('userContext', () => {
  const pbUserInfo = ref({
    userId: null,
    userName: null,
    balance: null,
  })

  const imUserInfo = ref({
    userId: null,
    userName: null,
    balance: null,
  })

  function setPbUserInfo(item) {
    pbUserInfo.value = item
  }

  function getPbUserInfo() {
    return pbUserInfo.value
  }

  function setImUserInfo(item) {
    imUserInfo.value = item
  }

  function getImUserInfo() {
    return imUserInfo.value
  }

  return {pbUserInfo, imUserInfo, setPbUserInfo, getPbUserInfo, getImUserInfo, setImUserInfo}
})
